package stub;

import java.util.List;

import blservice.college_logicservice.College_logicservice;
import data.CollegePlan;
import data.Course;
import data.CourseAssistInfo;
import data.Student;
import data.StudentCourScoreRecord;
import data.SubModel;
import data.TeachingFramework;
import enum_pck.ResultMessage;

public class College_logicservice_stub implements College_logicservice {
	TeachingFramework framework;
	CourseAssistInfo csi;
	List<StudentCourScoreRecord> soc;
	List<Student> students;

	public College_logicservice_stub(TeachingFramework framework,
			CourseAssistInfo csi, List<StudentCourScoreRecord> soc,
			List<Student> students) {
		super();
		this.framework = framework;
		this.csi = csi;
		this.soc = soc;
		this.students = students;
	}

	// framework_dataservice;

	@Override
	public TeachingFramework getFramework() {

		return this.framework;
	}

	@Override
	public ResultMessage editSubModel(String modelName, String subModelID,
			SubModel subModel) {
		System.out.println("edit successfully");
		return ResultMessage.Success;
	}

	@Override
	public ResultMessage commitPlan(CollegePlan p) {
		System.out.println("commit successfully");
		return ResultMessage.Success;
	}

	@Override
	public ResultMessage publishCourses(int grade, List<Course> courses) {
		System.out.println("Grade" + grade + ":");
		for (Course c : courses) {
			System.out.println(c);
		}
		return ResultMessage.Success;
	}

	@Override
	public ResultMessage addCourse(Course c) {
		// TODO Auto-generated method stub
		System.out.println("add successfully");
		return ResultMessage.Success;
	}

	@Override
	public CourseAssistInfo showCourseDetail(String courseID) {
		// TODO Auto-generated method stub
		System.out.println("course " + courseID + " :");
		System.out.println(this.csi);

		return this.csi;
	}

	@Override
	public List<StudentCourScoreRecord> getStudentsOfCourse(String courseID) {
		for (StudentCourScoreRecord s : this.soc) {
			System.out.println(s);
		}
		return soc;
	}

	@Override
	public ResultMessage changeCourse(String courseID, Course newCourse) {
		System.out.println("change successfully");
		return ResultMessage.Success;
	}

	@Override
	public ResultMessage changeScore(String courseID, String studentID,
			int newScore) {
		System.out.println("change successfully");
		return ResultMessage.Success;
	}

	@Override
	public List<Student> showStudents(int grade) {
		// TODO Auto-generated method stub
		for (Student s : students) {
			System.out.println(s);
		}
		return null;
	}

	@Override
	public ResultMessage saveChange(SubModel subModel) {
		// TODO Auto-generated method stub
		return null;
	}
}
